<template>
  <div v-show="item.isShow" :class="['f rw']">
    <div
      v-for="(col, index) in item.children.filter(v => v.isShow)"
      :key="col.id"
      class="rds5 rel"
      :style="{width:`${col.span}%`, border: modalType == 0 ?'1px dashed #ccc' : 'none', minHeight:'50px'}"
      @click.stop="selectItem(col)"
      @dragenter.stop="e => dragEnterSplit(e, index, col)"
      @drop.stop="e=> dragType ==1?drop(e, index) : ''"
    >
      <div v-if="mouseHoverItem.id == col.id" :class="['abs l0 r0 zx10 op6 t0']" style="height:6px;background:#1adaa7;"></div>
      <CusText v-if="col.type == 'text'" :item="col" @setItem="e=>col=e" :formData="formData" @setFormData="e => $emit('setFormData', e)" :modalType="modalType"></CusText>
      <CusDivide v-if="col.type == 'divide'" :item="col" @setItem="e=>col=e" :formData="formData" @setFormData="e => $emit('setFormData', e)" :modalType="modalType"></CusDivide>
      <CusInput v-if="col.type == 'input'" :item="col" @setItem="e=>col=e" :formData="formData" @setFormData="e => $emit('setFormData', e)" :modalType="modalType"></CusInput>
      <CusTextArea v-if="col.type == 'textarea'" :item="col" @setItem="e=>col=e" :formData="formData" @setFormData="e => $emit('setFormData', e)" :modalType="modalType"></CusTextArea>
      <CusRadio v-if="col.type == 'radio'" :item="col" @setItem="e=>col=e" :formData="formData" @setFormData="e => $emit('setFormData', e)" :modalType="modalType"></CusRadio>
      <CusCheckBox v-if="col.type == 'checkbox'" :item="col" @setItem="e=>col=e" :formData="formData" @setFormData="e => $emit('setFormData', e)" :modalType="modalType"></CusCheckBox>
      <CusSelect v-if="col.type == 'select'" :item="col" @setItem="e=>col=e" :formData="formData" @setFormData="e => $emit('setFormData', e)" :modalType="modalType"></CusSelect>
      <CusDate v-if="col.type == 'date'" :item="col" @setItem="e=>col=e" :formData="formData" @setFormData="e => $emit('setFormData', e)" :modalType="modalType"></CusDate>
      <CusUploadFile v-if="col.type == 'uploadFile'" :item="col" @setItem="e=>col=e" :formData="formData" @setFormData="e => $emit('setFormData', e)" :modalType="modalType"></CusUploadFile>
      <CusUploadImg v-if="col.type == 'uploadImg'" :item="col" @setItem="e=>col=e" :formData="formData" @setFormData="e => $emit('setFormData', e)" :modalType="modalType"></CusUploadImg>
      <CusBloodPressure v-if="col.type == 'bloodPressure'" :item="col" @setItem="e=>col=e" :formData="formData" @setFormData="e => $emit('setFormData', e)" :modalType="modalType"></CusBloodPressure>
      <CusPulseDorsalis v-if="col.type == 'pulseDorsalis'" :item="col" @setItem="e=>col=e" :formData="formData" @setFormData="e => $emit('setFormData', e)" :modalType="modalType"></CusPulseDorsalis>
      <CusCurrentAndTarget v-if="col.type == 'currentAndTarget'" :item="col" @setItem="e=>col=e" :formData="formData" @setFormData="e => $emit('setFormData', e)" :modalType="modalType"></CusCurrentAndTarget>
      <CusMedicine v-if="col.type == 'medicine'" :item="col" @setItem="e=>col=e" :formData="formData" @setFormData="e => $emit('setFormData', e)" :modalType="modalType"></CusMedicine>
      <CusSymptom v-if="col.type == 'symptom'" :item="col" @setItem="e=>col=e" :formData="formData" @setFormData="e => $emit('setFormData', e)" :modalType="modalType"></CusSymptom>
    </div>
  </div>
</template>
<script src='./index.js'></script>
<style src='./index.css' scoped>
</style>